package com.example.alyServices;

import com.aliyun.iot20180120.Client;

public class Sample {

    /**
     * 使用AK&SK初始化账号Client
     *
     * @param accessKeyId
     * @param accessKeySecret
     * @return Client
     * @throws Exception
     */
    public static Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
        com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
                // 必填，您的 AccessKey ID
                .setAccessKeyId("LTAI5t993wDQ5PEikZnLYSGX")
                // 必填，您的 AccessKey Secret
                .setAccessKeySecret("25LAcsidWU6Hz9XflRYjdzxs67EvZg");
        // Endpoint 请参考 https://api.aliyun.com/product/Iot
        config.endpoint = "iot.cn-shanghai.aliyuncs.com";
        return new Client(config);
    }
}
